package SoundEngine
{
	import flash.display.DisplayObjectContainer;
	import flash.display.Loader;
	import flash.events.Event;
	import flash.events.IEventDispatcher;
	import flash.events.IOErrorEvent;
	import flash.media.Sound;
	import flash.media.SoundChannel;
	import flash.media.SoundTransform;
	import flash.net.URLRequest;
	import flash.system.ApplicationDomain;
	import flash.system.LoaderContext;

	public class SoundEngine
	{		
		private var earPosX:Number	=	0;
		private var earPosZ:Number	=	0;
		
		private var sObjList:Vector.<SoundObject>	=	new Vector.<SoundObject>();
		
		public function SoundEngine()
		{
		}	
		
		public function panTo( wx:Number, wz:Number ):void
		{
			earPosX	=	wx;
			earPosZ	=	wz;
			
			updateEar();
		}
		
		public function panBy( dx:Number, dz:Number ):void
		{
			earPosX	+=	dx;
			earPosZ	+=	dz;
			
			updateEar();
		}
		
		private function updateEar():void
		{
			for( var i:String in sObjList )
				sObjList[i].updateEar( earPosX, earPosZ );
		}
		
		
		
		
		public function test():void
		{
			var s:SoundObject	=	new SoundObject( 0, 10, 10 );
			sObjList.push( s );
			
			s					=	new SoundObject( 10, 5, 10 );
			sObjList.push( s );
		}

		
		
		
		
		
		
		
		
		
	}
}